public class MartDemo {
    int price = 0;//购物券金额
    //根据优惠规则计算实付款以及获取的购物券金额
    void add(double sumMoney){
 if(sumMonry >=1000){
  sumMoney * =0.8;//八折优惠
  price = 200;//200元优惠券
 }else if(sumMoney>=500){
  sumMonet * =0.85;//八五折优惠
  price = 100;//100元优惠券
 }else if(sunMoney>=300){
  sumMoney * =0.9;//九折优惠
  price = 70;//70元优惠券
 }else{
  sumMoney * =0.95;//九五折优惠
 }
 System.out.println("实际付款金额:%8.2f",sunMoney);
 System.out.println("获取购物券金额:%d",price);
}
void add (int sunMoney1){
    if (sumMoney1>=1000){
        sumMoney1 *=0.8;//八折优惠
        price = 200;//200元优惠券
        }else if(sumMoney1>=500){
            sumMoney1 *=0.85;//八五折优惠
            price = 100;//100元购物券
            }else if(sumMoney1>=300{
                sumMoney1 *=0.9;//九折优惠
                price = 70;//70元购物券
                }else{
                    sumMoney1 *=0.95;//九五折优惠
                    }
                    System.out.println("实际付款金额：%d",sumMoney1);
                    System.out.println("获取购物券金额；%d",price);
                    }
                    public static void main(String args[]){
                        MartDemo md = new MartDemo();
                        md.add(50000.0);
                        System.out.println();
                        md.add(50000);
                        }
                        }